1. Field of the Invention
Apparatuses and method consistent with the present invention relate to an interpolation filter interpolating a reference picture for motion compensation, and more particularly, to generating an interpolation filter using an adjacent area of a current block and a corresponding adjacent area of a reference picture and interpolating the reference picture using the generated interpolation filter, and an image decoding method and apparatus therefor.
2. Description of the Related Art
In image compression methods, such as MPEG-1, MPEG-2, MPEG-4, and H.264/MPEG-4 Advanced Video Coding (AVC), in order to encode an image, a single picture is divided into macroblocks. Thereafter, each macroblock is encoded in all encoding modes available in inter prediction and intra prediction coding, and according to a bit rate required to encode a macroblock and a grade of distortion between an original macroblock and a decoded macroblock, an encoding mode is selected, and the macroblock is encoded.
Inter prediction comprises generating a motion vector by searching for an area of a reference picture similar to a block being currently encoded using at least one reference picture located before or after a picture being currently encoded and generating a prediction block of the current block by performing motion compensation using the generated motion vector.
The motion compensation is performed in a unit of fractional pixel resolution more minute than integer pixel resolution in order to increase prediction accuracy. For example, after a reference picture is interpolated by generating fractional pixels existing between integer pixels of the reference picture, such as half pels, quarter pels, and one eighth pels, motion compensation prediction is performed using the interpolated reference picture.
FIG. 1 is a diagram for explaining a reference image interpolation process according to the related art. In FIG. 1, pixels indicated using a perfect square denote integer pixels, and pixels indicated using a circle denote half pels existing between integer pixels. In addition, alphabet capital letters in square boxes denote integer pixels before interpolation is performed, and alphabet lower case letters in circles denote half pels between the integer pixels before interpolation is performed.
Referring to FIG. 1, half pels located between two integer pixels adjacent to each other in a horizontal direction are generated by applying a six-tap filter in the horizontal direction. For example, a half pel c located between integer pixels G and H in the horizontal direction is generated by applying a six-tap Finite Impulse Response (FIR) filter to six integer pixels located in the same row as the half pel c to be interpolated using an equation c=(E−5F+20G+20H−5I+J)/32. The weights {1, −5, 20, 20, −5, 1} assigned to the six integer pixels adjacent to the half pel to be interpolated, which are used in the equation, are called filter coefficients.
Similarly, half pels located between two integer pixels adjacent to each other in a vertical direction are generated by applying a six-tap FIR filter in the vertical direction. For example, a half pel f located between integer pixels G and M in the vertical direction is generated by applying a six-tap FIR filter to six integer pixels located in same column as the half pel f using an equation f=(A−CF+20G+20M−5R+T)/32. Although it is not shown, each quarter pel is calculated by obtaining a mean value of adjacent integer pixels or half pels.
According to the related art, filter coefficients of an interpolation filter are always fixed. This is because filter coefficients applied to each block must be transmitted to a decoder for image decoding if different interpolation filters are applied to each block. However, since encoded blocks can have different image characteristics, if motion compensation prediction by applying the same interpolation filter to all blocks is performed, prediction performance may be inefficient.